package org.lib.postgresqlhello.record.shard;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 按天切分的分表策略
 * @author ben
 * @date 2021-11-18 22:38:56 CST
 */
public class DateTableShardStrategy implements ITableShardStrategy {

	private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyyMMdd");
	
	@Override
	public String tableShard(String tableName) {
		return tableName + "_" + SDF.format(new Date());
	}

}
